//
//  AppDelegate.m
//  ZYThirdShare_OC
//
//  Created by 石志愿 on 2021/1/11.
//

#import "AppDelegate.h"
#import "ZYShareConstans.h"
#import "ZYShareManager.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //第三方登录分享
    [[ZYShareManager shared] registerSDK];
    return YES;
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    return [self openUrl:url];
}

- (BOOL)openUrl:(NSURL *)url {
    if ([url.host isEqualToString:@"safepay"]) {
        // 跳转支付宝app进行支付，处理支付结果
        return YES;
    }else if ([url.scheme hasPrefix:@"wx"] || [url.scheme hasPrefix:@"tencent"] || [url.scheme hasPrefix:@"wb"]) {
        return [[ZYShareManager shared] HandleOpenURL:url];
    }
    return YES;
}


@end
